package com.xiaolun.controller;

import com.xiaolun.mapper.OrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
public class OrderDelete {

    @Autowired
    private OrderMapper orderMapper;

    @RequestMapping(value = "/delete",method = RequestMethod.GET)
    @ResponseBody
    public String deleteUser(@RequestParam("id") int id){
        int result = this.orderMapper.deleteOrder(id);
        System.out.println("id值："+id);
        if (result != 0){//删除成功
            return "ok";
        } else{
            return "error";
        }
    }

}
